<div class='container'>
     <div class="tabbable"> <!-- Only required for left/right tabs -->
	<?=$tab_header;?>
       <div class="tab-content" style='height:450px;'>
         <div class="tab-pane active" id="table4"><?=$this->zetro_auth->allAuth($form,'active_member_list');?></div>
         <div class="tab-pane" id="table2"><?=$this->zetro_auth->allAuth($form2,'active_member_list');?></div>
         <div class="tab-pane" id="table3"><?=$this->zetro_auth->allAuth($form3,'active_member_list');?></div>
       </div>
    </div>
</div>
<input type='hidden' id='edited' value='<?=$id_mm;?>'/>
<input type='hidden' id='aksine' value='<?=$aksi;?>'/>
<? CalenderUI(); link_js(array('zetro_number','jquery.fixedheader'),'asset/js/');?>
<script language='javascript'>
$(document).ready(function(e) {
	$('#bod_member').datepicker();
	$('#bod_member').datepicker("option","dateFormat","dd/mm/yy");
	$('#tgl_masuk').datepicker();
	$('#tgl_masuk').datepicker("option","dateFormat","dd/mm/yy");
	$('#tgl_keluar').datepicker();
	$('#tgl_keluar').datepicker("option","dateFormat","dd/mm/yy");
	_get_member_detail($('#aksine').val());
	$('#simpan').live('click',function(){ _simpan_update();})
	$('#add_t').live('click',function(){_print_detail();});
});
function _get_member_detail(id)
{
	show_indicator2('rst');
	$.post('get_detail_aktiv_member',{'id_member':$('#edited').val()},
	function(result){
		var r=$.parseJSON(result);
		//tab1
		if(id=='update')
		{
			$('#simpan').removeAttr('disabled');
			$('#add_t').removeAttr('disabled');
		}else{
			$('#simpan').attr('disabled','disabled');
			$('#add_t').attr('disabled','disabled');
		}
		$('#frm2 #id_reg').val(r.id_reg).attr('readonly','readonly');
		$('#frm2 #id_lokasi').val(r.id_lokasi).select();
		$('#frm2 #nip_member').val(r.nip_member);	
		$('#frm2 #nm_member').val(r.nm_member);	
		$('#frm2 #sex_member').val(r.sex_member).select();	
		$('#frm2 #bop_member').val(r.bop_member);	
		$('#frm2 #bod_member').val(tglFromSql(r.bod_member));	
		$('#frm2 #add_member').val(r.add_member);	
		$('#frm2 #hp_member').val(r.hp_member);
		$('#frm2 #email_member').val(r.email_member);
		//tab2	
		//alert(r.tgl_masuk);
		$('#frm3 #no_anggota').val(r.id_reg).attr('readonly','readonly');
		$('#frm3 #tgl_masuk').val((r.tgl_msk.substr(0,4)=='0000' || r.tgl_msk=='')?'':tglFromSql(r.tgl_msk));	
		$('#frm3 #status_member').val(r.status_member).select();	
		$('#frm3 #tgl_keluar').val((r.status_member=='A')?'':tglFromSql(r.tgl_keluar));
		$('#frm3 #kode_kantor').val(r.kode_kantor).select();	
		$('#frm3 #bagian').val(r.bagian);	
		$('#frm3 #no_gaji').val(r.no_gaji);	
		$('#frm3 #rekening').val(r.rekening);
		//tab3
		$('#frm4 #simpanan_pokok').val(r.simpanan_pokok).attr('readonly','readonly').priceFormat();
		formatAngka('simpanan_pokok');
		$('#frm4 #saldo_wajib').val(r.saldo_wajib).attr('readonly','readonly').priceFormat();
		$('#frm4 #saldo_sukarela').val(r.saldo_sukarela).attr('readonly','readonly').priceFormat();
		$('#frm4 #saldo_pinjaman_uang').val(r.saldo_pinjaman_uang).attr('readonly','readonly').priceFormat();
		$('#frm4 #saldo_pinjaman_barang').val(r.saldo_pinjaman_barang).attr('readonly','readonly').priceFormat();
		$('#rst').html('');
	})
}

function _simpan_update()
{
	$.post('setupdatemember',$('#frm2').serialize()+'&'+$('#frm3').serialize()+'&'+$('#frm4').serialize(),
	function(result)
	{
		$('#batal').click();
	})
}


</script>